#include "widget.h"
#include "ui_widget.h"

#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    //初始化第一个输入框，用来输入姓名
    ui->lineEdit->setPlaceholderText("请输入姓名：");
    //设置清空按钮
    ui->lineEdit->setClearButtonEnabled(true);

    //初始化第三个按钮输入密码
    ui->lineEdit_2->setPlaceholderText("请输入密码：");
    ui->lineEdit_2->setClearButtonEnabled(true);
    //把显示模型设置为显示密码的模式
    ui->lineEdit_2->setEchoMode(QLineEdit::Password);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    qDebug()<<"姓名: "<<ui->lineEdit->text()
            <<"密码："<<ui->lineEdit_2->text();
}
